/*
 *    Copyright (c) 2018-2025, boss All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions are met:
 *
 * Redistributions of source code must retain the above copyright notice,
 * this list of conditions and the following disclaimer.
 * Redistributions in binary form must reproduce the above copyright
 * notice, this list of conditions and the following disclaimer in the
 * documentation and/or other materials provided with the distribution.
 * Neither the name of the boss developer nor the names of its
 * contributors may be used to endorse or promote products derived from
 * this software without specific prior written permission.
 * Author: boss
 */

package com.hopes.bizz.emergency.resources.entity;

import com.baomidou.mybatisplus.annotation.*;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.hopes.bizz.emergency.common.constant.enums.ParkEmergencySysDictEnum;
import com.hopes.boss.admin.api.resolver.DictResolver;
import com.hopes.boss.admin.api.resolver.enums.AdminDictEnum;
import com.hopes.boss.admin.api.resolver.enums.SysDictEnum;
import com.hopes.boss.common.entity.BaseEntity;
import com.hopes.boss.common.entity.BaseLogicEntity;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDate;
import java.util.Date;

/**
 * 应急队伍
 *
 * @author cx
 * @date 2023-11-03 15:11:39
 */
@Data
@TableName(value = "er_team")
@EqualsAndHashCode(callSuper = true)
@Schema(description = "应急队伍")
public class ErTeamEntity extends BaseLogicEntity {

    private static final long serialVersionUID = 1L;


	/**
	* 标识
	*/
    @TableId(type = IdType.ASSIGN_ID)
    @Schema(description="标识")
    private Long id;

	/**
	* 队伍名称
	*/
    @Schema(description="队伍名称")
    private String teamName;

	/**
	* 队伍性质
	*/
    @Schema(description="队伍性质")
    private Integer teamNature;

	/**
	* 所属单位
	*/
    @Schema(description="所属单位")
    private Long orgId;

	/**
	* 所属单位名称
	*/
    @Schema(description="所属单位名称")
    private String companyName;

	/**
	* 队伍级别
	*/
    @Schema(description="队伍级别")
    private Integer teamLevel;

	/**
	* 队伍类型
	*/
    @Schema(description="队伍类型")
    private Integer teamType;

	/**
	* 专业队伍类型
	*/
    @Schema(description="专业队伍类型")
    private Integer specialTeamType;

	/**
	* 队伍适用行业
	*/
    @Schema(description="队伍适用行业")
    private Integer teamApplyIndustry;

	/**
	* 擅长救援类型
	*/
    @Schema(description="擅长救援类型")
    private Integer goodRescueType;

	/**
	* 经费来源
	*/
    @Schema(description="经费来源")
    private String fundingSource;

	/**
	* 营区面积(m2)
	*/
    @Schema(description="营区面积(m2)")
    private BigDecimal campArea;

	/**
	* 营房建筑面积(m2)
	*/
    @Schema(description="营房建筑面积(m2)")
    private BigDecimal barracksBuildingArea;

	/**
	* 成立日期
	*/
    @Schema(description="成立日期")
    private LocalDate establishmentDate;

	/**
	* 填报单位
	*/
    @Schema(description="填报单位")
    private Long reportCompanyId;

	/**
	* 主要负责人
	*/
    @Schema(description="主要负责人")
    private String chargePerson;

	/**
	 * 是否使用
	 */
	@Schema(description="是否使用")
	private String useFlag;


	/**
	* 负责人联系电话
	*/
    @Schema(description="负责人联系电话")
    private String chargePersonPhone;

	/**
	* 办公电话
	*/
    @Schema(description="办公电话")
    private String officePhone;

	/**
	* 应急值班电话
	*/
    @Schema(description="应急值班电话")
    private String dutyPhone;

	/**
	* 应急值班传真
	*/
    @Schema(description="应急值班传真")
    private String dutyFax;

	/**
	* 队伍地址
	*/
    @Schema(description="队伍地址")
    private String address;

	/**
	* 定位
	*/
    @Schema(description="定位")
    private String location;

	/**
	* 队伍资质
	*/
    @Schema(description="队伍资质")
    private Integer teamQualifications;

	/**
	* 质量标准化等级
	*/
    @Schema(description="质量标准化等级")
    private String qualityStandardizationLevel;

	/**
	* 救援队证书编号
	*/
    @Schema(description="救援队证书编号")
    private String rescueTeamCertificateNo;

	/**
	* 发证机关
	*/
    @Schema(description="发证机关")
    private String licensingOrganizations;

	/**
	* 发证日期
	*/
    @Schema(description="发证日期")
    private LocalDate licensingDate;

	/**
	* 有效期
	*/
    @Schema(description="有效期")
	@JsonFormat(pattern = "yyyy-MM-dd")
    private Date expiryDate;

	/**
	* 专家个数
	*/
    @Schema(description="专家个数")
    private Integer expertNum;

	/**
	* 物资个数
	*/
    @Schema(description="物资个数")
    private Integer goodsNum;

	/**
	* 总人数（人）
	*/
    @Schema(description="总人数（人）")
    private Integer totalPerson;

	/**
	* 指挥员数（人）
	*/
    @Schema(description="指挥员数（人）")
    private Integer commanders;

	/**
	* 专职人数（人）
	*/
    @Schema(description="专职人数（人）")
    private Integer fullTimePerson;

	/**
	* 兼职人数（人）
	*/
    @Schema(description="兼职人数（人）")
    private Integer partTimePerson;

	/**
	* 中队个数（人）
	*/
    @Schema(description="中队个数（人）")
    private Integer squadronPerson;

	/**
	* 中队驻地（人）
	*/
    @Schema(description="中队驻地（人）")
    private Integer squadronResidentPerson;

	/**
	* 小队个数（人）
	*/
    @Schema(description="小队个数（人）")
    private Integer teamPerson;

	/**
	* 后勤人数（人）
	*/
    @Schema(description="后勤人数（人）")
    private Integer logisticsPerson;

	/**
	* 车辆数（辆）
	*/
    @Schema(description="车辆数（辆）")
    private Integer carCount;

	/**
	* 主要装备描述
	*/
    @Schema(description="主要装备描述")
    private String mainEquipmentDesc;

	/**
	* 备注
	*/
    @Schema(description="备注")
    private String remarks;

	/**
	* 近5年从事过的救援案例
	*/
    @Schema(description="近5年从事过的救援案例")
    private String rescueCases;

	/**
	* 经度
	*/
    @Schema(description="经度")
    private String longitude;

	/**
	* 维度
	*/
    @Schema(description="维度")
    private String latitude;

	/**
	* 高度
	*/
    @Schema(description="高度")
    private String altitude;

	/**
	* 附件
	*/
    @Schema(description="附件")
    private String files;

	/**
	 * 过期状态
	 */
	@Schema(description="过期状态")
	private Integer overdueStatus;


	public String getTeamNatureStr(){
		return DictResolver.getItemLabelByValue(ParkEmergencySysDictEnum.emergency_team_nature, this.getTeamNature());
	}

	public String getTeamLevelStr(){
		return DictResolver.getItemLabelByValue(ParkEmergencySysDictEnum.emergency_team_level, this.getTeamLevel());
	}

	public String getTeamTypeStr(){
		return DictResolver.getItemLabelByValue(ParkEmergencySysDictEnum.emergency_team_type, this.getTeamType());
	}
	public String getSpecialTeamTypeStr(){
		return DictResolver.getItemLabelByValue(ParkEmergencySysDictEnum.emergency_special_team_type, this.getSpecialTeamType());
	}
	public String getTeamApplyIndustryStr(){
		return DictResolver.getItemLabelByValue(ParkEmergencySysDictEnum.emergency_team_apply_industry, this.getTeamApplyIndustry());
	}
	public String getTeamQualificationsStr(){
		return DictResolver.getItemLabelByValue(ParkEmergencySysDictEnum.emergency_team_qualifications, this.getTeamQualifications());
	}
	public String getGoodRescueTypeStr(){
		return DictResolver.getItemLabelByValue(ParkEmergencySysDictEnum.emergency_good_handling_accidents, this.getGoodRescueType());
	}
	public String getOrgIdStr() {
		return DictResolver.getItemLabelByValue(AdminDictEnum.sys_company,this.orgId);
	}
	public String getUseFlagStr() {
		return DictResolver.getItemLabelByValue(SysDictEnum.yes_no_type, this.useFlag);
	}

	public String getOverdueStatusStr(){
		return DictResolver.getItemLabelByValue(ParkEmergencySysDictEnum.emergency_plan_overdue_status, this.getOverdueStatus());
	}

}